list_1 = [1,2,5,6,7,2,3,2,4,4]

list_2 = set(list_1)
list_3 = set([1,3,4,0,8,66,7])

print("list_2:",list_2,"\n",type(list_2))
print("list_3:",list_3)
# 交集
print(list_2.intersection(list_3))
print(list_2 & list_3)

# 并集
print(list_2.union(list_3))
print(list_2 | list_3)

# 差集
print(list_2.difference(list_3))
print(list_2 - list_3)

print(list_3.difference(list_2))
print(list_3 - list_2)

# 子集

print(list_2.issubset(list_3))  #子集
print(list_2.issuperset(list_3))  #父集
list_4 = set([2,3])
print(list_4.issubset(list_2))

# 对称差集
print(list_2.symmetric_difference(list_3))

# pop
print(list_1)
list_1.pop(1)
print(list_1)

# clear
# list_1.clear()
# print(list_1)

# remove
print(list_3)
list_3.remove(3)
print(list_3)
# list_3.remove(9) #9为不存在的值，会报错
# print(list_3)

# discard
print(list_3)
list_3.discard(9) # 9为不存在的值，不报错
print(list_3)

# copy
list_5=list_3.copy()
print(list_5)

# add
print(list_2)
list_2.add(0)
print(list_2)

# issubset
a=list_2.issubset(list_3)
print(a)

# issuperset
b=list_2.issuperset(list_3)
print(b)

# update
list_2.update(list_3)
print(list_2)

# intersection_update
list_2.intersection_update(list_3)
print(list_2)

#difference_update
list_2.difference_update(list_3)
print(list_2)

#symmetric_difference_update
list_2.symmetric_difference_update(list_3)
print(list_2)